import java.util.*;


public class MatrixColumnIterator implements Iterator<Double>{
	public ArrayList<Double> column;
	public int count;
	
	public MatrixColumnIterator(Matrix values, int m)
	{
		column = new ArrayList<Double>(values.getRowSize());
		for (int i = 0; i < values.getRowSize(); i++)
		{
			column.add(0, values.getValue(i, m));
		}
		count = 0;
	}
	public boolean hasNext() {
		return count < column.size();
	}

	public Double next() {
		if(count >= column.size())
			throw new NoSuchElementException();
		return column.get(count++);
	}

	public void remove() {
		throw new UnsupportedOperationException();	
	}

}
